namespace CoreManager.Models.DTOs
{
    /// <summary>
    /// 系统监控数据DTO
    /// </summary>
    public class SystemMonitorDto
    {
        /// <summary>
        /// CPU信息
        /// </summary>
        public CpuInfo Cpu { get; set; } = new();

        /// <summary>
        /// 内存信息
        /// </summary>
        public MemoryInfo Memory { get; set; } = new();

        /// <summary>
        /// 磁盘信息
        /// </summary>
        public DiskInfo Disk { get; set; } = new();

        /// <summary>
        /// 网络信息
        /// </summary>
        public NetworkInfo Network { get; set; } = new();

        /// <summary>
        /// 系统信息
        /// </summary>
        public SystemInfo System { get; set; } = new();

        /// <summary>
        /// 操作系统信息
        /// </summary>
        public OperatingSystemInfo OperatingSystem { get; set; } = new();
    }

    /// <summary>
    /// CPU信息
    /// </summary>
    public class CpuInfo
    {
        /// <summary>
        /// CPU使用率 (%)
        /// </summary>
        public double Usage { get; set; }

        /// <summary>
        /// CPU核心数
        /// </summary>
        public int Cores { get; set; }

        /// <summary>
        /// CPU温度 (°C)
        /// </summary>
        public double Temperature { get; set; }

        /// <summary>
        /// CPU频率 (GHz)
        /// </summary>
        public double Frequency { get; set; }

        /// <summary>
        /// CPU名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// CPU架构
        /// </summary>
        public string Architecture { get; set; } = string.Empty;
    }

    /// <summary>
    /// 内存信息
    /// </summary>
    public class MemoryInfo
    {
        /// <summary>
        /// 已使用内存 (GB)
        /// </summary>
        public double Used { get; set; }

        /// <summary>
        /// 总内存 (GB)
        /// </summary>
        public double Total { get; set; }

        /// <summary>
        /// 内存使用率 (%)
        /// </summary>
        public double Usage { get; set; }

        /// <summary>
        /// 可用内存 (GB)
        /// </summary>
        public double Available { get; set; }
    }

    /// <summary>
    /// 磁盘信息
    /// </summary>
    public class DiskInfo
    {
        /// <summary>
        /// 已使用空间 (GB)
        /// </summary>
        public double Used { get; set; }

        /// <summary>
        /// 总空间 (GB)
        /// </summary>
        public double Total { get; set; }

        /// <summary>
        /// 磁盘使用率 (%)
        /// </summary>
        public double Usage { get; set; }

        /// <summary>
        /// 读取速度 (MB/s)
        /// </summary>
        public double ReadSpeed { get; set; }

        /// <summary>
        /// 写入速度 (MB/s)
        /// </summary>
        public double WriteSpeed { get; set; }

        /// <summary>
        /// 磁盘驱动器列表
        /// </summary>
        public List<DriveInfo> Drives { get; set; } = new();
    }

    /// <summary>
    /// 驱动器信息
    /// </summary>
    public class DriveInfo
    {
        /// <summary>
        /// 驱动器名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 文件系统类型
        /// </summary>
        public string FileSystem { get; set; } = string.Empty;

        /// <summary>
        /// 总空间 (GB)
        /// </summary>
        public double TotalSize { get; set; }

        /// <summary>
        /// 可用空间 (GB)
        /// </summary>
        public double AvailableSpace { get; set; }

        /// <summary>
        /// 使用率 (%)
        /// </summary>
        public double Usage { get; set; }
    }

    /// <summary>
    /// 网络信息
    /// </summary>
    public class NetworkInfo
    {
        /// <summary>
        /// 上传速度 (MB/s)
        /// </summary>
        public double UploadSpeed { get; set; }

        /// <summary>
        /// 下载速度 (MB/s)
        /// </summary>
        public double DownloadSpeed { get; set; }

        /// <summary>
        /// 网络延迟 (ms)
        /// </summary>
        public double Latency { get; set; }

        /// <summary>
        /// 丢包率 (%)
        /// </summary>
        public double PacketsLost { get; set; }

        /// <summary>
        /// 网络接口列表
        /// </summary>
        public List<NetworkInterfaceInfo> Interfaces { get; set; } = new();
    }

    /// <summary>
    /// 网络接口信息
    /// </summary>
    public class NetworkInterfaceInfo
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 接口描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 接口状态
        /// </summary>
        public string Status { get; set; } = string.Empty;

        /// <summary>
        /// 接口类型
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 发送字节数
        /// </summary>
        public long BytesSent { get; set; }

        /// <summary>
        /// 接收字节数
        /// </summary>
        public long BytesReceived { get; set; }
    }

    /// <summary>
    /// 系统信息
    /// </summary>
    public class SystemInfo
    {
        /// <summary>
        /// 系统运行时间 (天)
        /// </summary>
        public double Uptime { get; set; }

        /// <summary>
        /// 运行进程数
        /// </summary>
        public int Processes { get; set; }

        /// <summary>
        /// 系统线程数
        /// </summary>
        public int Threads { get; set; }

        /// <summary>
        /// 系统负载平均值
        /// </summary>
        public List<double> LoadAverage { get; set; } = new();

        /// <summary>
        /// 启动时间
        /// </summary>
        public DateTime StartTime { get; set; }
    }

    /// <summary>
    /// 操作系统信息
    /// </summary>
    public class OperatingSystemInfo
    {
        /// <summary>
        /// 操作系统名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 操作系统版本
        /// </summary>
        public string Version { get; set; } = string.Empty;

        /// <summary>
        /// 操作系统架构
        /// </summary>
        public string Architecture { get; set; } = string.Empty;

        /// <summary>
        /// 操作系统平台
        /// </summary>
        public string Platform { get; set; } = string.Empty;

        /// <summary>
        /// 机器名称
        /// </summary>
        public string MachineName { get; set; } = string.Empty;

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; } = string.Empty;

        /// <summary>
        /// 域名
        /// </summary>
        public string UserDomainName { get; set; } = string.Empty;

        /// <summary>
        /// .NET版本
        /// </summary>
        public string DotNetVersion { get; set; } = string.Empty;
    }

    /// <summary>
    /// 进程信息DTO
    /// </summary>
    public class ProcessInfoDto
    {
        /// <summary>
        /// 进程ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 进程名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// CPU使用率 (%)
        /// </summary>
        public double Cpu { get; set; }

        /// <summary>
        /// 内存使用量 (MB)
        /// </summary>
        public double Memory { get; set; }

        /// <summary>
        /// 进程状态
        /// </summary>
        public string Status { get; set; } = string.Empty;

        /// <summary>
        /// 启动时间
        /// </summary>
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 线程数
        /// </summary>
        public int Threads { get; set; }

        /// <summary>
        /// 句柄数
        /// </summary>
        public int Handles { get; set; }
    }

    /// <summary>
    /// 系统告警信息DTO
    /// </summary>
    public class SystemAlertDto
    {
        /// <summary>
        /// 告警ID
        /// </summary>
        public string Id { get; set; } = string.Empty;

        /// <summary>
        /// 告警类型
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 告警消息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 告警时间
        /// </summary>
        public DateTime Timestamp { get; set; }

        /// <summary>
        /// 是否已解决
        /// </summary>
        public bool Resolved { get; set; }

        /// <summary>
        /// 告警级别
        /// </summary>
        public string Level { get; set; } = string.Empty;

        /// <summary>
        /// 告警来源
        /// </summary>
        public string Source { get; set; } = string.Empty;
    }
}
